package com.github.ilioili.justdoit.widget;

import android.content.Context;
import android.support.v7.widget.CardView;
import android.util.AttributeSet;

/**
 * Created by hantuo on 16/5/28.
 */
public class CircleCardView extends CardView {
    public CircleCardView(Context context) {
        super(context);
    }

    public CircleCardView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public CircleCardView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, widthMeasureSpec);
        setRadius(getMeasuredWidth()/2);
    }
}
